package com.example.mytayunapi.Mapper;

import com.example.mytayunapi.Entity.publicInfo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface publicInfoMapper {
    @Insert("insert into public(Public_title,Public_content,operator) " +
            "values(#{Public_title},#{Public_content},#{operator})")
    Integer InsertPublicInfo(publicInfo publicinfo);

    @Select("SELECT * FROM tayun.public where Public_title = #{Public_title}")
    List<publicInfo> GetPublicInfo(String Public_title);

    @Select("SELECT * FROM tayun.public")
    List<publicInfo> getPublicInfo();

    @Delete("delete FROM tayun.public where Public_title = #{Public_title}")
    Integer DeletePublicInfo(String Public_title);

    @Update("update public set Public_title = #{Public_title} ,Public_content =#{Public_content}," +
            "Public_time = #{Public_time} where Public_id = #{Public_id}")
    Integer UpdatePublicInfo(publicInfo publicinfo);

}
